#include <algorithm>
#include <iostream>
#include <vector>

/**
 * NewCoder KY23: Minimal Cost of Railway Travelling
 */

int L[3], C[3];
std::vector<int> dist;

void solve() {
    std::vector<int> cost(dist.size(), 0);
    for (int i = 1; i < cost.size(); i++) {
        int minCost = INT32_MAX;
        int j = i - 1, level = 0;
        while (j >= 0 && level < 3) {
            int d = dist[i] - dist[j];
            if (d <= L[level]) {  // within distance of current level
                minCost = std::min(minCost, cost[j] + C[level]);
                j--;
            } else  // exceed distance limit, move to next level
                level++;
        }
        cost[i] = minCost;
    }
    printf("%d\n", cost.back());
}

int main() {
    while (scanf("%d %d %d", &L[0], &L[1], &L[2]) != EOF) {
        // Read all data
        scanf("%d %d %d", &C[0], &C[1], &C[2]);
        int A, B, N;
        scanf("%d %d %d", &A, &B, &N);
        A--, B--;
        if (A == B) {
            printf("%d\n", 0);
            continue;
        } else if (A > B)
            std::swap(A, B);
        std::vector<int> allDist(N, 0);
        for (int i = 1; i < N; i++) scanf("%d", &allDist[i]);

        // Compute distance between two stations.
        dist = std::vector<int>(allDist.begin() + A, allDist.begin() + B + 1);

        // Solve problem
        solve();
    }
}